package com.csw.android.videofloatwindow.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.csw.android.videofloatwindow.entities.PlaySheet;
import com.csw.android.videofloatwindow.entities.PlaySheetVideo;
import com.csw.android.videofloatwindow.entities.VideoInfo;

import com.csw.android.videofloatwindow.greendao.PlaySheetDao;
import com.csw.android.videofloatwindow.greendao.PlaySheetVideoDao;
import com.csw.android.videofloatwindow.greendao.VideoInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig playSheetDaoConfig;
    private final DaoConfig playSheetVideoDaoConfig;
    private final DaoConfig videoInfoDaoConfig;

    private final PlaySheetDao playSheetDao;
    private final PlaySheetVideoDao playSheetVideoDao;
    private final VideoInfoDao videoInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        playSheetDaoConfig = daoConfigMap.get(PlaySheetDao.class).clone();
        playSheetDaoConfig.initIdentityScope(type);

        playSheetVideoDaoConfig = daoConfigMap.get(PlaySheetVideoDao.class).clone();
        playSheetVideoDaoConfig.initIdentityScope(type);

        videoInfoDaoConfig = daoConfigMap.get(VideoInfoDao.class).clone();
        videoInfoDaoConfig.initIdentityScope(type);

        playSheetDao = new PlaySheetDao(playSheetDaoConfig, this);
        playSheetVideoDao = new PlaySheetVideoDao(playSheetVideoDaoConfig, this);
        videoInfoDao = new VideoInfoDao(videoInfoDaoConfig, this);

        registerDao(PlaySheet.class, playSheetDao);
        registerDao(PlaySheetVideo.class, playSheetVideoDao);
        registerDao(VideoInfo.class, videoInfoDao);
    }
    
    public void clear() {
        playSheetDaoConfig.clearIdentityScope();
        playSheetVideoDaoConfig.clearIdentityScope();
        videoInfoDaoConfig.clearIdentityScope();
    }

    public PlaySheetDao getPlaySheetDao() {
        return playSheetDao;
    }

    public PlaySheetVideoDao getPlaySheetVideoDao() {
        return playSheetVideoDao;
    }

    public VideoInfoDao getVideoInfoDao() {
        return videoInfoDao;
    }

}
